package com.panshi.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * <p>
 * 用户表 
 * </p>
 *
 * @author 小伍
 * @since 2020-08-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BeiUser对象", description="用户表 ")
public class BeiUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "uid", type = IdType.AUTO)
    private Integer uid;

    @ApiModelProperty(value = "用户昵称")
    private String name;

    @ApiModelProperty(value = "用户姓名")
    private String username;

    @ApiModelProperty(value = "性别")
    private String gender;

    @Size(min = 6,max = 10,message = "密码在6到十位之间")
    @ApiModelProperty(value = "用户密码")
    private String password;

    @Pattern(regexp ="^[1][3,4,5,7,8][0-9]{9}$", message = "请输入正确的手机号码")
    @ApiModelProperty(value = "电话号码")
    private String iphone;

    @Pattern(regexp ="[1-9]\\d{7,10}@qq\\.com", message = "请输入正确的邮箱")
    @ApiModelProperty(value = "用户邮箱")
    private String email;

    @ApiModelProperty(value = "个人简介")
    private String introduce;

    @ApiModelProperty(value = "头像地址")
    private String imgpath;

    @ApiModelProperty(value = "记录提问总数")
    private Integer quizCount;

    @ApiModelProperty(value = "记录用户回答总数")
    private Integer answerCount;

    @ApiModelProperty(value = "记录文章总数")
    private Integer articleCount;

    @ApiModelProperty(value = "最后登录时间")
    private Date lastLoginTime;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "状态(1 启用 0 禁用)")
    private String state;


}
